<?php TPL::output('admin/global/header.tpl.htm'); ?>
<?php TPL::output('admin/global/nav_menu.tpl.htm'); ?>

<div class="aw-content-wrap">
    <div class="mod">
        <div class="tab-content mod-content">
            <div class="tab-pane active" id="add">
            <div class="table-responsive">
            <form action="admin/ajax/save_advertise/" id="settings_form" method="post">
            <table class="table table-striped">
                <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-4 col-xs-3 control-label"><?php _e('广告名称'); ?>:</span>
                            <div class="col-sm-5 col-xs-8">
                                <input class="form-control" name="title" type="text" value="<?php echo $this->advertise_info['title']; ?>" required="required" />
                                 <input type="hidden" value="<?php echo $this->advertise_info['id']; ?>" name="id" >    
                            </div>
                        </div>
                    </td>
                </tr>             
                <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-4 col-xs-3 control-label"><?php _e('广告描述'); ?>:</span>
                            <div class="col-sm-5 col-xs-8">
                                <input class="form-control" name="desc" value="<?php echo $this->advertise_info['desc']; ?>" type="text" required="required"/>
                            </div>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-4 col-xs-3 control-label"><?php _e('关联文章ID'); ?>:</span>
                            <div class="col-sm-5 col-xs-8">
                                <input class="form-control" name="bind_id" type="text" value="<?php echo $this->advertise_info['bind_id']; ?>" required="required" />
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-4 col-xs-3 control-label"><?php _e('跳转地址'); ?>:</span>
                            <div class="col-sm-5 col-xs-8">
                                <input class="form-control" name="link_url" type="text" required="required"  value="<?php echo $this->advertise_info['link_url']; ?>"/>
                            </div>
                        </div>
                    </td>
                </tr>
                 <tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题图片'); ?>:</span>
							<div class="col-sm-4 col-xs-8 nopadding">
								<div class="col-sm-12">
								<span class="mod-file">
									<input type="button" class="btn btn-primary" value="点击选择图片" />
									<input type="file" name="icon" exts="png|jpg|bmp|jpeg" class="mod-input-file" />
                                                                        <input type="hidden" name="old_img" value="<?php echo $this->advertise_info['img_url']; ?>">
								</span>
								<span class="help-block"><?php _e('规格'); ?>: 900px x 240px, <?php _e('支持上传图片类型'); ?>: jpg,jpeg,gif,png</span>
								</div>
                                                             <span class="col-sm-4"><?php if ($this->advertise_info['img_url']) echo get_feature_pic_url('max', $this->advertise_info['img_url']); ?></span>
							</div>	
                                                       
						</div>
					</td>
				</tr>

                <tfoot>
                <tr>
                    <td>
                        <input type="button" value="<?php _e('编辑广告'); ?>" class="btn btn-primary center-block" onclick="AWS.ajax_post($('#settings_form'));" />
                    </td>
                </tr>
                </tfoot>
            </table>
            </form>
            </div>
            </div>

        </div>
    </div>
</div>

<script>
	$(function(){
		 $('.mod-input-file').change(function(){
			$('.filetext').text($('.mod-input-file').val());
		});
	})
</script>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>